using WXWorkSvc.Models;

namespace WXWorkSvc.Pages.Suite;

public class StartAuthModel : PageModel
{
    public async Task<IActionResult> OnGet([FromServices] WXWork3rd wx, [FromServices] WXWorkConfig config, string id)
    {
        var url = await wx.GetAgentAuthUrlAsync(id, $"{config.ApplicationUrl}/suite/authcallback/{id}",true);
        return Redirect(url);
    }
}
